-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log by default to journald on systems with systemd #8942
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change because it makes our software behave similar to other services running on a host.
I think we'll need to add some documentation that explains how to view the logs with journalctl. One worry I have is that users will make config changes to logging.to_X
or logging.files.*
and expect them to take affect but those settings are pre-empted by the -e
. Maybe there are some things we can do to mitigate that risk (probably just via docs).
CHANGELOG.asciidoc
Outdated
@@ -14,6 +14,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff] | |||
*Affecting all Beats* | |||
|
|||
- Dissect syntax change, use * instead of ? when working with field reference. {issue}8054[8054] | |||
- Add `-e` flag by default to systemd unit so logs are collected by journald, behaviour can be reverted by overriding BEAT_LOG_OPTS environment variable with an empty value {pull}[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd word this as a more direct statement toward systemd users, like "On systems with systemd the Beat logs are now written to journald by default rather than file. ..." Or some other wording that makes the breaking change get noticed by those affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, changelog rephrased, added also to developers changelog.
a3068fe
to
8eab223
Compare
Added documentation page to include details about the use of systemd with Beats. |
Could you please rebase your branch? |
@dedemorton could you please review the docs added? Thanks! |
Pinging @elastic/infrastructure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! Some editorial changes, but otherwise looks good. I wonder if we should add links to this page from the getting started docs?
@dedemorton thanks for your suggestions! I have applied them. |
I am going to merge this so it gets into the next 7.0 builds. |
As we talked offline, we can open another PR for more changes in docs if needed.
libbeat/docs/shared-systemd.asciidoc
Outdated
|
||
NOTE: It is recommended that you use a configuration management tool to | ||
include drop-in unit files. If you need to add a drop-in manually, use | ||
`systemctl edit {beatname_lc}.service`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change:
`systemctl edit {beatname_lc}.service`
To
+systemctl edit {beatname_lc}.service+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, true, you already mentioned that, thanks!
I have wrapped a couple more command lines that were unwrapped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsoriano I missed one minor correction. Commands that contain attributes (like {beatname_lc}) need to be wrapped in plus signs, not back ticks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc changes LGTM.
jenkins, test this again |
Failures in jenkins not related |
This overrides the defaults in the unit file for out services so that we get a log file. The tests currently assert that the log exists. We could extend the tests to assert that logs are written to journald in the future. Relates to elastic/beats#8942
This overrides the defaults in the unit file for out services so that we get a log file. The tests currently assert that the log exists. We could extend the tests to assert that logs are written to journald in the future. Relates to elastic/beats#8942
Add `-e` flag to command line when running beats from systemd so beats logs are collected by journald by default in systems with systemd. Add also some environment variables so command line flags can be more easily overriden with a drop-in unit or with `systemctl edit`. Add documentation about the use of Beats with systemd.
Add
-e
flag to command line when running beats from systemd so beats logs are collected by journald by default in systems with systemd.Add also some environment variables so command line flags can be more easily overriden with a drop-in unit or with
systemctl edit
.Add documentation about the use of Beats with systemd.